﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyAlbum.Services
{
    public class GenericUser : IUser
    {
        private string _userName;
       
        public GenericUser() { }
        public GenericUser(string userName, string[] roles)
        {
            this._userName = userName;
            this.Roles = new List<string>(roles);
        }
        #region IUser Members

        public string Name
        {
            get { return _userName; }
            set { _userName = value; }
        }

        public bool IsInRole(string role)
        {
            return Roles.Contains(role);
        }

        public string Email { get; set; }

        public string Password { get; set; }

        public List<string> Roles { get; set; }

        public override string ToString()
        {
            return this.Name;
        }
        #endregion
    }
}
